feat(FR-2611): retire Craco/Webpack — build, Makefile, CI all on Vite/Vitest#6876
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Conversation
This was referenced Apr 22, 2026
Contributor
Author
This was referenced Apr 22, 2026
Merged
ace1b59 to
818d02a
Compare
0bcadfc to
0c5139e
Compare
This was referenced Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Retires the Craco/Webpack + Jest pipeline and switches the repo’s React workspace and CI testing to Vite + Vitest.
Changes:
- Update
react/scripts to usevite/vite buildandvitest run. - Remove CRA/Craco configuration and the
react-scripts@5.0.1pnpm patch entry. - Replace the Jest coverage workflow with a multi-workspace Vitest workflow (react, backend.ai-ui, root).
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
react/src/react-app-env.d.ts |
Deleted CRA-era ambient typings (needs a Vite-era replacement for still-used globals/types). |
react/patches/react-scripts@5.0.1.patch |
Removed no-longer-needed react-scripts patch file. |
react/package.json |
Switch scripts to Vite/Vitest; devDependencies partially cleaned up. |
react/craco.config.cjs |
Deleted Craco/Webpack configuration. |
react/babel.config.cjs |
Deleted CRA/Jest-era Babel configuration. |
pnpm-workspace.yaml |
Removed react-scripts@5.0.1 patched dependency entry. |
.github/workflows/vitest.yml |
New Vitest-based CI workflow with per-workspace jobs. |
Comments suppressed due to low confidence (3)
.github/workflows/vitest.yml:14
- The workflow trigger/path filters don’t include
react/vite.config.ts. Since this PR migrates the build pipeline to Vite and that file materially affects dev/build behavior, changes to it would currently bypass this workflow entirely (nocheck-changesjob, no Vitest). Please addreact/vite.config.tsto bothon.pull_request.pathsand thepaths-filterrules so CI runs when Vite config changes.
.github/workflows/vitest.yml:56 react-viteststill runsjwalton/gh-find-current-pr@v1(stepid: findPr), but the PR number output is no longer used after removing the Jest coverage report action. Removing this step will speed up CI a bit and avoids an unnecessary external action dependency.
.github/workflows/vitest.yml:136root-vitestusesactions/checkout@v4andpnpm/action-setup@v4while the other jobs use@v5. Aligning these to the same major versions across jobs reduces maintenance overhead and avoids subtle behavior differences between jobs.
0c5139e to
560dea4
Compare
6c1b86d to
7f03080
Compare
a68b158 to
ff24662
Compare
027a403 to
1f59ad5
Compare
ff24662 to
ed450f5
Compare
1f59ad5 to
d578ec5
Compare
d578ec5 to
5fc6577
Compare
ed450f5 to
07e96d8
Compare
This was referenced Apr 30, 2026
Merge activity
|
…/Vitest (#6876) Resolves #6814(FR-2611) ## Summary With `vite build` proven in FR-2608 and Vitest landed across all three workspaces (FR-2609 + follow-up), this PR retires the Craco/Webpack build pipeline entirely. **-772 lines / +62 lines.** ### Build - `react/package.json`: - `start`: `craco start` → `vite` - `build:only`: `craco build` → `vite build` - `test`: `jest` → `vitest run` ### Makefile - `dep` target's probe pattern updated from `es6://static/js/main` (CRA/webpack chunk layout) to `es6://assets/index-` (Vite output layout, proven in FR-2607). ### CI - Renames `.github/workflows/jest.yml` → `vitest.yml`. - Replaces the Jest coverage action with plain `pnpm run vitest` across three jobs: `react-vitest`, `backend-ai-ui-vitest`, `root-vitest`. - **NOTE**: branch-protection rules that reference the old job names (`react-coverage`, `backend-ai-ui-coverage`) must be updated to the new names, otherwise the vitest check won't be a required status. ### Dep cleanup (`react/package.json`) Removed: - `@craco/craco`, `react-scripts`, `babel-preset-react-app`, `react-dev-utils`, `html-webpack-plugin`, `workbox-webpack-plugin` - `babel-jest`, `webpack`, `baseline-browser-mapping`, `caniuse-lite`, `prop-types`, `stream-browserify`, `identity-obj-proxy` - `jest`, `jest-canvas-mock`, `jest-environment-jsdom` Also removed the `react-scripts@5.0.1` patched-dependency entry from `pnpm-workspace.yaml` and its `.patch` file, and deleted `react/craco.config.cjs`, `react/babel.config.cjs`, `react/src/react-app-env.d.ts`, and the empty `react/public/`. ## Verification - [x] `pnpm run build:only` in `react/` produces `build/index.html` + `build/assets/*` - [x] Electron build: `BUILD_TARGET=electron pnpm run vite:build` emits `es6://assets/index-*` URLs - [x] `make dep` completes end-to-end, packages Electron app from the new build layout - [x] All three Vitest suites green (856 + 315 + 90) - [x] Lint + format clean across all three workspaces ## Stack Builds on the Vitest follow-up. Additional runtime bug-fix PRs (manifest, global, webpackIgnore) stacked on top of this one.
5fc6577 to
b598d84
Compare
07e96d8 to
eaec713
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 30, 2026
Resolves #6809(FR-2606) ## Summary Dev-server regression noticed after the Vite cutover: pages that mount a Monaco editor break at mount time because the `/resources/monaco/vs/*` URL prefix no longer resolves on the dev server. `@monaco-editor/react` loads the Monaco AMD runtime at runtime via: ```ts loader.config({ paths: { vs: '/resources/monaco/vs' } }); ``` (see `react/src/helper/monacoEditor.ts`). The self-hosted prefix exists so the editor works in offline / air-gapped deployments where jsDelivr is unreachable. Pre-Vite, the dev-server side of this contract was the `static` directory list in `react/craco.config.cjs` (lines 44–60 of the now-deleted file): it served `react/node_modules/monaco-editor/min/vs/*` at the `/resources/monaco/vs` URL prefix. Production builds copy the same tree to `build/web/resources/monaco/vs/` via the root `copymonaco` script (`package.json:32`). After #6876 (FR-2611) dropped `craco.config.cjs`, the production `copymonaco` step was preserved but the dev-server-side mapping was not ported to `vite.config.ts`. As a result, in `pnpm run dev`, requests to `/resources/monaco/vs/loader.js` 404 and any page that mounts a Monaco editor breaks. **Fix**: add `monacoStaticPlugin()` to `react/vite.config.ts` mirroring the deleted craco `static` entry. - Serves `/resources/monaco/vs/*` from `react/node_modules/monaco-editor/min/vs/*`. - `apply: 'serve'` — dev-only; production is unchanged because `copymonaco` already populates `build/web/resources/monaco/vs/`. - Path-traversal guard via `filePath.startsWith(monacoRoot)` after `join` normalization. - Registered in the `plugins` array before `projectRootStaticPlugin()` so the narrower Monaco prefix is matched first. ## Verification - [x] `bash scripts/verify.sh` — Relay / Lint / Format / TypeScript all PASS - [ ] `pnpm run dev`, navigate to a Monaco-mounting page (manifest editor on Environments page) — editor renders without console errors, no `cdn.jsdelivr.net` fetches - [ ] DevTools → Network: `/resources/monaco/vs/loader.js`, `/resources/monaco/vs/editor/editor.main.js` return 200 from the dev server ## Stack Top of the Vite migration follow-up stack. Sits on top of #7083 (FR-2748).
Base automatically changed from
04-21-feat_migrate_bui_root_tests_from_jest_to_vitest_follow-up_to_fr-2609_
to
main
April 30, 2026 12:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #6814(FR-2611)
Summary
With
vite buildproven in FR-2608 and Vitest landed across all three workspaces (FR-2609 + follow-up), this PR retires the Craco/Webpack build pipeline entirely. -772 lines / +62 lines.Build
react/package.json:start:craco start→vitebuild:only:craco build→vite buildtest:jest→vitest runMakefile
deptarget's probe pattern updated fromes6://static/js/main(CRA/webpack chunk layout) toes6://assets/index-(Vite output layout, proven in FR-2607).CI
.github/workflows/jest.yml→vitest.yml.pnpm run vitestacross three jobs:react-vitest,backend-ai-ui-vitest,root-vitest.react-coverage,backend-ai-ui-coverage) must be updated to the new names, otherwise the vitest check won't be a required status.Dep cleanup (
react/package.json)Removed:
@craco/craco,react-scripts,babel-preset-react-app,react-dev-utils,html-webpack-plugin,workbox-webpack-pluginbabel-jest,webpack,baseline-browser-mapping,caniuse-lite,prop-types,stream-browserify,identity-obj-proxyjest,jest-canvas-mock,jest-environment-jsdomAlso removed the
react-scripts@5.0.1patched-dependency entry frompnpm-workspace.yamland its.patchfile, and deletedreact/craco.config.cjs,react/babel.config.cjs,react/src/react-app-env.d.ts, and the emptyreact/public/.Verification
pnpm run build:onlyinreact/producesbuild/index.html+build/assets/*BUILD_TARGET=electron pnpm run vite:buildemitses6://assets/index-*URLsmake depcompletes end-to-end, packages Electron app from the new build layoutStack
Builds on the Vitest follow-up. Additional runtime bug-fix PRs (manifest, global, webpackIgnore) stacked on top of this one.